<!-- computed,watch语法 -->
<template>
    <div>
       {{ a }} + {{ b }} = {{ getNum }}
    </div>
</template>

<script setup lang='ts'>
import {computed,watch,ref} from 'vue'
const a = ref(1)
const b = ref(2)
const getNum = computed({
    get(){
        return a.value+b.value
    },
    set(val){
        console.log(val)
    }
})
watch(a, () => {} ,{deep:true})
</script>

<style lang='less' scoped>

</style>